package com.Demo.flowcontrol.ifdemo;

import java.util.Scanner;

public class IfDemo {
    public static void main(String[] args) {
        //求2个数的较大值
        Scanner sc = new Scanner(System.in);
        //提示
        System.out.println("请您输入第一个数:");
        int num1 = sc.nextInt();
        //提示
        System.out.println("请您输入第二个数:");
        int num2 = sc.nextInt();

        //比较
        if (num1 > num2){
            System.out.println("较大值是:" + num1);
        }else{
            System.out.println("较大值是:" + num2);
        }
    }
}
